-- @owner: lvlintao
-- @date: 2025-11-18
-- @testpoint: D兼容性-结合触发器使用，成功
@connect PrimaryDbDmode;

--step1 结合触发器使用;expect:成功
drop table if exists case0007;
create table case0007 (id int,name varchar(20));
CREATE OR REPLACE FUNCTION tri_case0001() RETURNS TRIGGER AS
      $d$
      DECLARE
      output uuid;
      BEGIN
          select newid() into output;
          raise info 'INFO: output is %',output;
          return new;
      END;
$d$ LANGUAGE PLPGSQL;
/

CREATE TRIGGER table_trigger
      BEFORE INSERT ON case0007
      FOR EACH ROW
      EXECUTE PROCEDURE tri_case0001();/

insert into case0007 values(1,'tom');

--step2 清理环境;expect:成功
drop trigger table_trigger on case0007;
drop function if exists tri_case0001;
drop table if exists case0007;


